package com.FKASGradle;
import android.app.Activity;
import android.os.Bundle;
import com.FKASGradle.R;
import android.widget.TextView;
import flanagan.analysis.Regression;

public class MainActivity extends Activity {
   static{
      System.loadLibrary("FKASGradle");
      System.loadLibrary("lua");
   }
   private native void initlua();
   private native void freelua();
   private native String hello(String s);
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      Regression g=new Regression(new double[]{1.,2.,3.,4.},new double[]{2.,4.,6.,8.});
      initlua();
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      TextView tv=(TextView)findViewById(R.id.myLabel);
      tv.setText(hello("'hello'..' lua'..(2+3)"));
   }
   @Override
   protected void onDestroy(){
      super.onDestroy();
      freelua();
   }
}